#include <QtGui/QApplication>
#include <KDE/Nepomuk/ResourceManager>
#include <KDE/Nepomuk/Tag>
#include <KDE/Nepomuk/Resource>
#include <KDE/Nepomuk/File>
#include <phonon/MediaObject>

#include <vlc/libvlc.h>
#include <vlc/libvlc_media.h>
#include <vlc/libvlc_media_player.h>
#include <phonon/videoplayer.h>
#include "mainwindow.h"
#include <QDebug>
#include <QMdiArea>
#include <QMdiSubWindow>
#include <QtDeclarative/QDeclarativeView>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    /*Nepomuk::ResourceManager::instance()->init();
    Nepomuk::Resource f("/home/manu/image107.jpg");
    qDebug()<<"exists:"<< f.exists();*/
    //Nepomuk::Tag tag( "MyTag42" );
    //tag.setLabel("myLabel");
    //tag.setProperty();
    //f.addTag( tag );
    //Nepomuk::File f2("/home/manu/La\ Légende\ De\ Bruce\ lee\ 2011.avi");
    /*QList<Nepomuk::Tag> tags = f.tags();
    QListIterator<Nepomuk::Tag> it( tags );
    while( it.hasNext() ){
        Nepomuk::Tag t = it.next();
        qDebug() << "File tagged with tag: " << t.genericLabel() << " ==>"<< t.label() ;
    }*/
    //MainWindow w;
    QString texts = "/home/manu/movie.avi";

    //QWidget * parent = new QWidget();
    //QMdiArea* area = new QMdiArea();
    Phonon::VideoPlayer * player = new Phonon::VideoPlayer(Phonon::VideoCategory);

    QDeclarativeView * qmlViewer = new QDeclarativeView();
    qmlViewer->setResizeMode(QDeclarativeView::SizeRootObjectToView);
    qmlViewer->setWindowFlags(Qt::FramelessWindowHint);
    qmlViewer->setSource(QUrl::fromLocalFile("/socMDC/KdeadMouse/apps/videoplayer/qml/progressBar.qml"));
    qmlViewer->setAttribute(Qt::WA_TranslucentBackground);
    qmlViewer->setStyleSheet("background:transparent;");
    qmlViewer->setWindowModality(Qt::ApplicationModal);

    qmlViewer->show();

    player->play(QUrl(texts));

    player->setGeometry(50,50,700,500);
    player->show();


    return a.exec();
}
